function init(){
		var PPagerows=5;
		var Pinsertpointid=null;
		var Pnowpage=null;
}
function put(insertpointID,json){
		var point=document.getElementById("point");
		point.innerHTML="";
		let table=document.createElement("table");
		table.style="border:1px solid";
		let tr=document.createElement("tr");
		tr.style="border:1px solid";
		let data=json.data.PageDataMap;
		
			
		for(var k in data[0]){ 
			if(k!="R"){
			let td=document.createElement("td");
			td.innerHTML=k;
			td.style="border:1px solid";
			tr.appendChild(td);
		}
		}
			table.appendChild(tr);
			for(let i=0;i<data.length;i++){
				let tr1=document.createElement("tr");
				tr1.style="border:1px solid";
				for(var k in data[i]){ 
					if(k!="R"){
					let td=document.createElement("td");
					td.innerHTML=data[i][k];
					td.style="border:1px solid";
					tr1.appendChild(td);
				}
			}
				table.appendChild(tr1);	
		} 
			
			
		
		
		point.appendChild(table);
		let lbutton =document.createElement("button");
		lbutton.className="btn_page";
		lbutton.innerHTML="上一页";
		lbutton.addEventListener("click",changepageup,false);
		let nbutton =document.createElement("button");
		nbutton.className="btn_page";
		nbutton.innerHTML="下一页";
		nbutton.addEventListener("click",changepagedown,false);
		point.appendChild(lbutton);
		point.appendChild(nbutton);
		
		
	}	
	function changepageup(){
			
			
			 Pnowpage--;
			 getDate(PPagerows,Pinsertpointid,Pnowpage);
			
	}
	function changepagedown(){
		
		
		 Pnowpage++;
		 getDate(PPagerows,Pinsertpointid,Pnowpage);
		
}
	function getDate(Pagerows,insertpointID,nowpage){
		PPagerows=Pagerows;
		Pinsertpointid=insertpointID;
		Pnowpage=nowpage;
		let au=new AjaxUtils;
		let param="testPage.servlet?pagerows="+Pagerows+"&nowpage="+nowpage;
		au.ajaxRequest(param,(xhr)=>{
			let json=JSON.parse(xhr.responseText);
			put(insertpointID,json);
		});
	}
	
	window.addEventListener("load",init,false);
	



